package thread.basic;
/*
使用匿名内部类实现多线程的两种方式
 */
public class Demo04_TwoTypesImpThread {
    public static void main(String[] args) {

        //继承Thread类
        new Thread() {
            //重写run()方法
            @Override
            public void run() {
                for (int i = 0; i < 100000; i++) {
                    System.out.println("aaaaaaaaaaaaaaa");
                }
            }
        }.start();


        //实现Runnable接口
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100000; i++) {
                    System.out.println("bbbbbbbbbbbbbbbbbbb");
                }
            }
        }).start();
    }
}
